# -*- coding: utf-8 -*-

"""
Module implementing Vondelmain.
"""
import sys
from PyQt4.QtCore import pyqtSlot
from PyQt4.QtGui import QApplication,  QMainWindow,  QMessageBox,  QDialog

from .Ui_Vondelmain import Ui_Vondelmain
from .BookDialog import BookDialog
from .editor import EditorWindow

class Vondelmain(QMainWindow, Ui_Vondelmain):
    """
    Class documentation goes here.
    """
    def __init__(self, parent = None):
        """
            Constructor
        """
        QMainWindow.__init__(self, parent)
        self.setupUi(self)

    @pyqtSlot()
    def on_actionQuit_triggered(self):
        """
            Quit Vondel.s
        """
        self.close()

    @pyqtSlot()
    def on_action_About_Vondel_triggered(self):
        """
            Show About dialog.
        """
        QMessageBox.information(self, 'Vondel',
            QApplication.translate('Vondel Main', 'Vondel - The Writer\'s Assistent\n(c)2010 Jeffrey Rusterholz <jeffrey@jalava.nl>\nGPL licensed'))

    @pyqtSlot()
    def on_action_Book_Properties_triggered(self):
        """
            Book properties dialog.
        """
        dlg = BookDialog(self)
        if dlg.exec() == QDialog.Accepted:
            QMessageBox.information(self, 'Props',  dlg.BookTitleEdit.text())

    @pyqtSlot()
    def on_actionNew_Scene_activated(self):
        """
        Slot documentation goes here.
        """
        # TODO: not implemented yet
        ed = EditorWindow()
        ed.main()
